SetMediaDataHandler
TheSetMediaDataHandler
function allows you to assign a data handler to a media.
pascal OSErr SetMediaDataHandler (Media theMedia, short index, DataHandlerComponent dataHandler);
theMedia
- Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as
NewTrackMedia
andGetTrackMedia
(described on page 2-138 and page 2-190, respectively).index
- Identifies the data reference for this data handler. You provide the
index value that corresponds to the data reference. You must set this parameter to 1.dataHandler
- Specifies the data handler for the media. This identifier is a component instance that specifies a connection to a data handler component (see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for more information about components). If the data handler you specify cannot work with the data stored in the media, the function does not change the media's data handler.
DESCRIPTION
When you create a new media or load an existing media into memory, the media handler assigns an appropriate data handler to the track's media.
- Note
- Your application should not call the
SetMediaDataHandler
function. The Movie Toolbox assigns a data handler to each media when you load a movie.![]()
ERROR CODES
badComponentType -2005 Component cannot accommodate this data invalidMedia -2008 This media is corrupted or invalid